<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>vue指令</title>
    <script type="text/javascript" src="../../js/vue.js"></script>
    <style>
        [v-cloak] {
            display: none;
        }
    </style>
</head>
<body>
<div id="app">
    <p ref="content">mask</p>
    <button @click="hint">提示</button>

    <p v-cloak>{{msg}}</p>
</div>
</body>
</html>
<script type="text/javascript">
    alert("--")
    const VM = new Vue({
        el: '#app',
        data: {
            msg: 'mask22'
        },
        methods: {
            hint() {
                alert(this.$refs.content.textContent)
            }
        }
    })
</script>